package com.rchat.pocmini.activity.changepwd;

import com.aso.common.http.delegate.HttpCallbackImpl;
import com.aso.common.http.utils.HttpUtils;
import com.rchat.pocmini.global.HttpCodeGlobal;
import com.rchat.pocmini.global.RequestParam;
import com.rchat.pocmini.global.UrlsGlobal;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by ljd on 2017/8/31.
 */

public class ChangePwdModelImpl implements ChangePwdContract.Model {

    @Override
    public void changePwd(String userName, String newPassword, String oldPassword, HttpCallbackImpl callback) {

        Map<String, String> param = new HashMap<>();
        param.put("userName", userName);
        param.put("newPassword", newPassword);
        param.put("oldPassword", oldPassword);
        //body = {"code":1018,"data":{"platform":1,"version":"1.0","enterprise":1,"newPassword":"123456","oldPassword":"123456","userName":"111110000118"}}
        String body = RequestParam.requestRootParam(HttpCodeGlobal.REQ_CODE_1018, param);
        HttpUtils.postAsyn(UrlsGlobal.getUrl(UrlsGlobal.CHANGE_PASSWORD), body, callback);
    }
}
